package com.sunwayworld.basemodule.business.qualitycontrol.qualitycontrolresult.resource.impl;

import com.alibaba.fastjson.JSONObject;
import com.sunwayworld.basemodule.business.qualitycontrol.qualitycontrolresult.bean.LimsQualitycontrolTestResultBean;
import com.sunwayworld.basemodule.business.qualitycontrol.qualitycontrolresult.resource.LimsQualitycontrolTestResultResource;
import com.sunwayworld.basemodule.business.qualitycontrol.qualitycontrolresult.service.LimsQualitycontrolTestResultService;
import com.sunwayworld.framework.data.page.Page;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogModule;
import com.sunwayworld.framework.log.annotation.LogType;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@LogModule("质控结果数据表")
@RestController
@GikamBean
public class LimsQualitycontrolTestResultResourceImpl implements LimsQualitycontrolTestResultResource {

    @Autowired
    private LimsQualitycontrolTestResultService limsQualitycontrolTestResultService;

    @Override
    public LimsQualitycontrolTestResultService getService() {
        return limsQualitycontrolTestResultService;
    }

    @Log(value = "新增质控结果数据表", type = LogType.INSERT)
    @Override
    @RequestMapping(method = RequestMethod.POST)
    public Long insert(RestJsonWrapperBean wrapper) {
        return getService().insert(wrapper);
    }

    @Override
    public String insertTestResult(RestJsonWrapperBean jsonWrapperBean) {
        return getService().insertTestResult(jsonWrapperBean);
    }

    @Override
    public JSONObject getChosableProfessionalGroup(RestJsonWrapperBean jsonWrapperBean) {
        return getService().getChosableProfessionalGroup(jsonWrapperBean);
    }

    @Override
    public Page<LimsQualitycontrolTestResultBean> selectDistinctRows(RestJsonWrapperBean wrapper) {
        return getService().selectDistinctRows(wrapper);
    }

    @Override
    public JSONObject saveToManageTable(RestJsonWrapperBean wrapper) {
        return getService().saveToManageTable(wrapper);
    }

    @Override
    public JSONObject updateTestResult(RestJsonWrapperBean jsonWrapperBean) {
        return getService().updateTestResult(jsonWrapperBean);
    }

    @Override
    public JSONObject submit(RestJsonWrapperBean wrapperBean) {
        return getService().submit(wrapperBean);
    }

    @Override
    public JSONObject back(RestJsonWrapperBean wrapperBean) {
        return getService().back(wrapperBean);
    }
}
